﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PepsiCo.Business
{
    public partial class pepsi_User
    {
        public bool IsAdmin()
        {
            return ((this.pepsi_User_Roles.Any(p => p.pepsi_Role.RoleName == Role.Admin)
                        ||
                    this.pepsi_User_Groups.Any(ug => ug.pepsi_Group.pepsi_Role_Groups.Any(
                       rg => rg.pepsi_Role.RoleName == Role.Admin))));

        }
    }
}
